<%@page import="helpers.StringHelper"%>
<%@page import="java.util.Map"%>
<%@page import="entities.MetaSeo"%>
<%@page import="java.util.TreeMap"%>
<%@page import="helpers.UrlHelper"%>
<%@page import="java.util.ArrayList"%>
<%
TreeMap check = (TreeMap) request.getAttribute("check");
TreeMap values = (TreeMap) request.getAttribute("values");
String success = (String) request.getAttribute("success");
MetaSeo metaseo = (MetaSeo) request.getAttribute("metaseo");

//Set content for Seo
Map<String, String> replates = new TreeMap<String, String>();
replates.put("__SERVER_NAME__", UrlHelper.getDomainServer(request));
replates.put("__SERVER_URL__", UrlHelper.getServerUrl(request));


String title = StringHelper.replateContent(metaseo.getTitle(), replates);
String description = StringHelper.replateContent(metaseo.getDescription(), replates);
String keywords = StringHelper.replateContent(metaseo.getKeywords(), replates);
String url = StringHelper.replateContent(metaseo.getOgurl(), replates);
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="/templates/showsite/layouts/header.jsp" />

		<div class="row-fluid">
		
			<div class="span8">
				<div class="row-fluid">
					<section>
						<div class="f-info">
							<h3>Contact Us</h3>
							<div class="content-block">
								<% if (success != null) { %>
								<div class="alert alert-success">
									<button type="button" class="close" data-dismiss="alert">&times;</button>
								  	<%=success %>
								</div>
								<% } %>
								<p>
									<span class="dropcap">I</span>f you have any questions, or comments and suggestions, please use the form below to contact us.
								</p>
								<form method="post">
									<div class="control-group <%=check.get("name") != null ? "error" : "" %>">
										<label>Your name</label>
					                    <input type="text" placeholder="Please enter your name" class="required requiredField email span8" name="name" data-original-title="" value="<%=values.get("name") != null ? values.get("name") : "" %>">
					                    <% if (check.get("name") != null ) { %>
					                    <br />
					                    <span class="help-inline"><%=check.get("name") %></span>
					                    <% } %>
					                </div>
					                <div class="control-group <%=check.get("email") != null ? "error" : "" %>">
					                    <label>Your Email</label>
					                    <input type="text" placeholder="Please enter a contact email..." class="required requiredField email span8" name="email" value="<%=values.get("email") != null ? values.get("email") : "" %>" data-original-title="">
					                    <% if (check.get("email") != null ) { %>
					                    <br />
					                    <span class="help-inline"><%=check.get("email") %></span>
					                    <% } %>
				                    </div>
				                    
				                    <div class="control-group <%=check.get("title") != null ? "error" : "" %>">
										<label>Title</label>
					                    <input type="text" placeholder="Please enter your title..." class="required requiredField email span10" name="title" value="<%=values.get("title") != null ? values.get("title") : "" %>" data-original-title="">
					                    <% if (check.get("title") != null ) { %>
					                    <br />
					                    <span class="help-inline"><%=check.get("title") %></span>
					                    <% } %>
					                </div>
					                
					                <div class="control-group <%=check.get("content") != null ? "error" : "" %>">
										<label>Message Content</label>
					                    <textarea placeholder="Please enter your enquiry..." rows="10" cols="100%" name="content" class="required requiredField span10" data-original-title=""><%=values.get("content") != null ? values.get("content") : "" %></textarea>
					                    <% if (check.get("content") != null ) { %>
					                    <br />
					                    <span class="help-inline"><%=check.get("content") %></span>
					                    <% } %>
					                </div>
									
									<div class="control-group <%=check.get("captcha") != null ? "error" : "" %>">
		                                <script>
								        	var RecaptchaOptions = { theme : 'white'};
								  		</script>
										<script type="text/javascript" src="http://api.recaptcha.net/challenge?k=6LeA0c4SAAAAAMsdjrB49GPol6XImTdJM2U2AHrF"></script>
										<% if (check.get("captcha") != null ) { %>
										<br />
					                    <span class="help-inline"><%=check.get("captcha") %></span>
					                    <% } %>
									</div>
									
									<input id="submit" class="btn btn-inverse" type="submit" value="Submit Enquiry" name="submit">
								</form>
							</div>
						</div>
					</section>
					
				</div>
			</div>
			<jsp:include page="/templates/showsite/elements/right.jsp" />
		</div>
	
<jsp:include page="/templates/showsite/layouts/footer.jsp" />